<?php
namespace app\api\controller;
use app\api\model\Agency;
use think\Controller;
class Search extends Controller{
    //订单即时查询
    public function identsearch(){
        $id = input('id');
        $data = input('keyword');
        $search = new Agency;
        $results = $search->indentwater($id,$data);
        if($results){
            AjaxReturn('1','查询成功',['results'=>$results]);
        }else{
            AjaxReturn('1','未查询到数据');
        }
    }
    //推广明细既时查询
    public function recommendsearch(){
        $id = input('id');
        $data = input('keyword');
        $search = new Agency;
        $results = $search->recommend($id,$data);
        if($results){
            AjaxReturn('1','查询成功',['results'=>$results]);
        }else{
            AjaxReturn('1','未查询到数据');
        }
    }
    //代理商返利明细查询
    public function pushsearch(){
        $id = input('id');
        $data = input('keyword');
        $search = new Agency;
        $results = $search->pushwater($id,$data);
        if($results){
            AjaxReturn('1','查询成功',['results'=>$results]);
        }else{
            AjaxReturn('1','未查询到数据');
        }
    }
    //代理商收益明细查询
    public function earnings(){
        $id = input('id');
        $data = input('keyword');
        $search = new Agency;
        $results = $search->earnings($id,$data);
        if($results){
            AjaxReturn('1','查询成功',['results'=>$results]);
        }else{
            AjaxReturn('1','未查询到数据');
        }
    }
}
